<?php 

require_once('../../../conexiones/cn.php');
require_once('../../../includes/common/KT_common.php');
require_once('../../../includes/tng/tNG.inc.php');

// begin Recordset
$query_rsNivel = "SELECT id_nivel, des_nivel FROM nivel";
$rsNivel = $cn->SelectLimit($query_rsNivel) or die($cn->ErrorMsg());
$totalRows_rsNivel = $rsNivel->RecordCount();
// end Recordset

// begin Recordset
$query_rsCurso = "SELECT id_curso, des_curso FROM curso WHERE id_nivel = ". $_POST['id_nivel']."";
$rsCurso = $cn->SelectLimit($query_rsCurso) or die($cn->ErrorMsg());
$totalRows_rsCurso = $rsCurso->RecordCount();
// end Recordset

?>
				<select name="id_curso" id="id_curso">
						<?php
				  while(!$rsCurso->EOF){
				?>
						<option value="<?php echo $rsCurso->Fields('id_curso')?>"<?php if (!(strcmp($rsCurso->Fields('id_curso'), $_POST['id_curso']))) {echo "SELECTED";} ?>><?php echo $rsCurso->Fields('des_curso')?></option>
						<?php
					$rsCurso->MoveNext();
				  }
				  $rsCurso->MoveFirst();
				?>	
				 </select>